﻿<!doctype html>
<html lang="en">
<head>
    <meta charset="UTF-8">
    <title>好书速购-CRM管理系统</title>
    <meta name="renderer" content="webkit">
    <meta http-equiv="X-UA-Compatible" content="IE=edge,chrome=1">
    <meta name="viewport" content="width=device-width,user-scalable=yes, minimum-scale=0.4, initial-scale=0.8,target-densitydpi=low-dpi" />
    <link rel="shortcut icon" href="/education/favicon.ico" type="image/x-icon" />
    <link rel="stylesheet" href="/education/css/font.css">
    <link rel="stylesheet" href="/education/css/style.css">
    <link rel="stylesheet" href="/education/css/xadmin.css">
    <link rel="stylesheet" href="/static/layui/css/layui.css" media="all">
    <script type="text/javascript" src="https://cdn.bootcss.com/jquery/3.2.1/jquery.min.js"></script>
    <script type="text/javascript" src="/static/layui/layui.js" charset="utf-8"></script>
    <!--
    <script type="text/javascript" src="/education/js/xadmin.js"></script>
    -->
    <script type="text/javascript" src="/education/js/echarts.min.js"></script>
    <style>
        .layui-input-inline {
            padding-bottom: 5px;
        }
        input::-webkit-outer-spin-button,
        input::-webkit-inner-spin-button {
            -webkit-appearance: none;
        }

        input[type="number"] {
            -moz-appearance: textfield;
        }
    </style>
    <!-- 让IE8/9支持媒体筛选，从而兼容栅格 -->
    <!--[if lt IE 9]>
    <script src="https://cdn.staticfile.org/html5shiv/r29/html5.min.js"></script>
    <script src="https://cdn.staticfile.org/respond.js/1.4.2/respond.min.js"></script>
    <![endif]-->

</head>
<body class="login-bg">
<div class="login layui-anim layui-anim-up">
    <div class="message">好书速购-CRM管理系统</div>
    <div id="darkbannerwrap"></div>
    <form method="post" class="layui-form">
        <input name="mobile" placeholder="手机号码" type="number" min="1" class="layui-input">
        <hr class="hr15">
        <input name="password" placeholder="密码" type="password" class="layui-input">
        <hr class="hr15">
        <input value="登录" class="login_btn" lay-submit lay-filter="login" style="width:100%;" type="submit">
        <hr class="hr20">
    </form>
</div>
<div class="footer">
    <div class="copyright">Copyright © <a href="https://www.xiaowuzhushou.com/" target="_blank" style="color: #ccc;">湖南万学网络科技有限公司</a>

        <a href="https://www.beian.miit.gov.cn" target="_blank" style="color: #ccc;">湘ICP备18022993号</a></div>
</div>
<script>
    layui.use(['jquery','element', 'form', 'layer'], function () {
        var $ = layui.jquery,
                layer = layui.layer,
                element = layui.element,
                form = layui.form;

        // 提交数据
        $(document).on("click", ".login_btn", function () {
            var mobile = $("input[name='mobile']").val();
            var password = $("input[name='password']").val();
            if((mobile).length != 11){
                layer.msg('请输正确的11位手机号码');
                return false;
            }
            if (!mobile || mobile == '') {
                layer.msg('手机号码不能为空', {
                    time: 2000
                });
                return false;
            }
            if (!password || password == '') {
                layer.msg('密码不能为空', {
                    time: 2000
                });
                return false;
            }
            $.ajax({
                type: "post",
                url: "{:url('Account/checkLogin')}",
                data: {
                    mobile: mobile,
                    password: password
                },
                success: function (rJson) {
                    if (rJson.success === false) {
                        layer.msg(rJson.data.error,{time: 2000});
                    } else {
                        location.href = "/admin/Index/index";
                    }
                },
                error: function (error) {
                    console.log(error)
                }
            });
            return false;
        });

        $('#verify').keypress(function (e) {
            // 回车键事件
            if (e.which == 13) {
                $(".login_btn").click();
            }
        });
    });
</script>
</body>
</html>
